package model;

import javax.microedition.lcdui.Graphics;

import screen.PaintPopup;
import screen.RoomListScr;
import utilities.GameResource;

import font.BitmapFont;

public class RoomInfo extends ItemInfo {
    public byte roomFree;
    public byte roomWait;
    public byte lv;
	public boolean m_bIsSelected;
    
	public RoomInfo(byte id, byte roomFree, byte roomWait, byte lv) {
		super();
		this.m_iId = id;
		this.roomFree = roomFree;
		this.roomWait = roomWait;
		this.lv = lv;
	}
	public RoomInfo() {
	}
	public void paintInRow(Graphics g, int x, int y, int width, int height, boolean isFocus){
		int color = 0x9be5ff;
		if(m_bIsSelected)
			color = 0xfbd634;
		
		PaintPopup.paintRoundRect(g, x, y, 32, 32, 10, color);
		PaintPopup.paintRoundRect(g, x, y + 2, width, 28, 10, color);
		
		GameResource.instance.m_frameIconItems.drawFrame(RoomListScr.m_iIconGame, x + 4, y + 4, 0, g);
		if(RoomListScr.m_iIconGame == 13){
			BitmapFont.drawBoldFont(g, "Trường " + m_iId, x + 40, y + height/2, 0x3a001e, Graphics.VCENTER | Graphics.LEFT);
		}
		else
			BitmapFont.drawBoldFont(g, "Khu " + m_iId, x + 40, y + height/2, 0x3a001e, Graphics.VCENTER | Graphics.LEFT);
		
		if(roomFree == 2){
			g.setColor(0xff0000);
		}
		else if(roomFree == 1){
			g.setColor(0xffff00);
		}else if(roomFree == 0){
			g.setColor(0x00ff00);
		}
		g.setColor(0x3c8dc0);        	
    	g.fillRoundRect(x + width - 20, y + height/2, 5, 5, 5, 5);

	}
}
